// pages/01homePage/06order/manage.js
var app = getApp()
var appData = app.globalData
Page({
    data: {
        order: '',
        table: ''
    },

    onLoad: function (opt) {
        console.log('appData---------', appData)
        var obj = JSON.parse(opt.table)
        wx.setNavigationBarTitle({
            title: obj.fenlei + obj.zhuo + '菜单',
        })
        var param = {
            seat_fee: appData.shopInfo.shopInfo.seat_fee,
            orderid: obj.orderid,
        }
        var that = this
        app.getJsonData('api/space/table_eat_bill.php', param, function (res) {
            that.setData({
                order: res.data,
                table: obj
            })
            console.log('成功获取账单that.data', that.data)
        })
    },

    wifiPrint: function () {
        var obj = this.data.table
        var param = {
            orderid: obj.orderid,
            seat_fee: appData.shopInfo.seat_fee,
            shop_name: appData.shopInfo.shop,
            table_name: obj.fenlei + obj.zhuo
        }
        app.getJsonData('api/space/table_print.php', param, function (res) {
            wx.showToast({
                title: res.message,
                image: '/pages/images/qzg_logo_90x.jpg'
            })
        })
    }
})